let baseurl = 'http://freeze.ganmiaoedu.com';
import axios from 'axios'
const axio = (url, data) => {
  let token = localStorage.getItem('token');
  axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  return new Promise((resolve, reject) => {
    axios.post(baseurl + url, data, {
      headers: {
        token: token
      }
    })
      .then(res => {
        resolve(res);
      })
      .catch(err => {
        reject(err)
      })
  })
}

export default axio